package com.lemon.smartsafetynew.util.common;

import android.content.Intent;
import android.net.Uri;

import com.lemon.smartsafety.app.IApplication;

/**
 * Created by Andrew on 2017/9/28.
 */

public class CallUtils {

    /**
     * 呼叫号码
     *
     * @param telephoneNum
     */
    public static boolean callTel(String telephoneNum) {

        Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + telephoneNum));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        IApplication.context().startActivity(intent);
        return true;

    }

    /**
     * 附带号码的跳转拨号页面，但不呼叫
     *
     * @param telephoneNum
     */
    public static void jumpCallTelPage(String telephoneNum) {

        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + telephoneNum));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        IApplication.context().startActivity(intent);

    }
}
